package com.foreknow.demo9;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        List<Map<String,Student>> list = new ArrayList();

        Student student1 = new Student(001,"wded","ed","ww");
        Student student2 = new Student(002,"eded","ede","eded");
        Map<String,Student> map1 = new HashMap<>();
        map1.put("student1",student1);
        map1.put("student2",student2);
        list.add(map1);
        Map<String,Student> map2 = new HashMap<>();
        Student student3 = new Student(003,"ede","wdwd","wsw");
        Student student4 = new Student(004,"wdwe","wdw","qwsw");
        map2.put("student3",student3);
        map2.put("student4",student4);
        list.add(map2);
        Map<String,Student> map3 = new HashMap<>();
        Student student5 = new Student(005,"dww","wdw","wdw");
        Student student6 = new Student(006,"wdw","wdw","fvvf");
        map3.put("student5",student5);
        map3.put("student6",student6);
        list.add(map3);
        Iterator<Map<String,Student>> it = list.iterator();
        while (it.hasNext()){
            Map<String,Student> map = new HashMap<>();
            map = it.next();
            Set<Map.Entry<String,Student>> set = map.entrySet();
            Iterator<Map.Entry<String,Student>> it1 = set.iterator();
            while (it1.hasNext()){
                Map.Entry<String,Student> m = it1.next();
                System.out.println(m.getKey()+"---"+m.getValue().getSid()+"---"+m.getValue().getName()+"---"+m.getValue().getSchool()+"---"+m.getValue().getPhone());
            }
        }
    }
}
